package com.bdc.Util

import org.I0Itec.zkclient.serialize.ZkSerializer
import org.apache.commons.io.Charsets

class MyZkSerializer extends ZkSerializer{

  import org.I0Itec.zkclient.exception.ZkMarshallingError

  @throws[ZkMarshallingError]
  def deserialize(bytes: Array[Byte]) = new String(bytes, Charsets.UTF_8)

  @throws[ZkMarshallingError]
  def serialize(obj: Any): Array[Byte] = String.valueOf(obj).getBytes(Charsets.UTF_8)
}
